{extend name="common:base" /}

{block name="title"}登录 - {$config.site_name}{/block}

{block name="css"}
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" rel="stylesheet">
{/block}

{block name="main"}
<div class="mdui-container">
  <main>
    <div class="mdui-row">
      <div class="login-container">
        <div class="panel mdui-col-sm-6 mdui-col-md-6 mdui-col-offset-sm-3 mdui-col-offset-md-3">
          <div class="panel-header">登录账号</div>
          <div class="panel-body-box">
            <form action="{:url('auth/login')}" method="post">
              {include file="common:alert"}
              <div class="mt-3">
                <label class="mdui-textfield-label">登录方式</label>
                <select class="mdui-select" mdui-select name="type">
                  <option value="email" {if input('post.type') === 'email'} selected{/if}>邮箱</option>
                  <option value="username" {if input('post.type') === 'username'} selected{/if}>用户名</option>
                </select>
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                <label class="mdui-textfield-label">账号</label>
                <input class="mdui-textfield-input" type="text" name="account" value="{:input('post.account')}"/>
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                <label class="mdui-textfield-label">密码</label>
                <input class="mdui-textfield-input" type="password" name="password"/>
              </div>
              <div class="mdui-textfield mdui-textfield-floating-label">
                <button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">登录</button>
              </div>
              {:token()}
            </form>
            <p class="mdui-clearfix mdui-m-t-1">
              <a class="mdui-float-left" href="{:url('auth/forgot')}">忘记密码？</a>
              <a class="mdui-float-right" href="{:url('auth/register')}">注册账号</a>
            </p>
          </div>
        </div>
      </div>
    </div>
  </main>
</div>
{/block}

{block name="js"}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js"></script>
{/block}
